package button;

import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.Sound;
import org.newdawn.slick.geom.Vector2f;

public class PressedButton extends Button {

	public PressedButton(float sx, float sy, float width, float height, int flag, Image img, Sound snd)
	{
		super(sx,sy,width,height, flag, img, snd);
	}
	
	@Override
	public int click(Input input) {
		if(!isVisible || !isActivity) return 0;
		initInput(input);
		
		mouseX = input.getMouseX();
		mouseY = input.getMouseY();
		
		if(isOn()) 
			if(input.isMousePressed(mouseButton))
				if(!isClicked)
				{
					isClicked = true;
					canHover = false;
					wasClicked = true;
					if(canMusicPlay) snd.play();
					return flag;
				}			
		return 0;
	}
	public void deClick()
	{
		isClicked = false;
		canHover = true;
	}
	


}
